<?php
$this->title = "揭示版一览";
$this->registerMetaTag(["name" => "keywords", "content" => "无名论坛"]);
$this->registerMetaTag(["name" => "description", "content" => "无名论坛揭示版一览"]);
?>

<div class="main mb20">

    <!-- Nav tabs -->
    <div role="tabpanel" style="position:relative;">

        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation"><a href="<?= Yii::$app->urlManager->createUrl('member/info') ?>">个人资料</a></li>
            <li role="presentation" class="active"><a href="<?= Yii::$app->urlManager->createUrl('member/index') ?>">我的揭示板</a></li>
            <li role="presentation"><a href="<?= Yii::$app->urlManager->createUrl('member/collect') ?>">收藏</a></li>
            <li role="presentation"><a href="<?= Yii::$app->urlManager->createUrl('member/comment') ?>">评论</a></li>            
            <li role="presentation"><a href="<?= Yii::$app->urlManager->createUrl('member/post') ?>">我发表的</a></li>
            <li role="presentation"><a href="<?= Yii::$app->urlManager->createUrl('member/message') ?>">消息</a></li>
        </ul>


        <!-- Tab panes -->
        <div class="tab-content pd20">
            <div role="tabpanel" class="tab-pane active" id="one">

                <?php use common\WuMing;

                if (!Yii::$app->user->isGuest):?>
                    <h4>已关注的揭示板：</h4>
                    <ul class="list-inline">
                        <?php foreach (WuMing::getUserCategory(Yii::$app->user->id, false) as $v): ?>
                            <li class="col-xs-3">
                                <a type="button" class="btn btn-info btn-block"
                                   href="<?= Yii::$app->urlManager->createUrl(['post/index', 'cid' => $v['id']]) ?>"><?= $v['name'] ?>
                                    <span class="badge pull-right"><?= WuMing::getCategoryPostCount($v['id']) ?></span></a>
                            </li>
                        <?php endforeach ?>
                    </ul>
                    <div class="clearfix"></div>
                    <?php if($manage):?>
                    <hr>
                    <h4>我管理的讨论板：</h4>

                    <ul class="list-inline">
                        <?php foreach( $manage as $v): ?>
                            <li class="col-xs-3">
                                <a type="button" class="btn btn-info btn-block"
                                   href="<?= Yii::$app->urlManager->createUrl(['post/index', 'cid' => $v['cate']['id']]) ?>"><?= $v['cate']['name'] ?>
                                    <span class="badge pull-right"><?= WuMing::getCategoryPostCount($v['cate']['id']) ?></span></a>
                            </li>
                        <?php endforeach ?>
                    </ul>
                    <div class="clearfix"></div>

                    <?php endif?>
                    <hr/>
                    <!-- <h4>创建揭示板 <span style="font-size: 15px">在线时间需满100小时</span> </h4>
                    <a href="<?=Yii::$app->urlManager->createUrl('apply')?>" class="btn btn-block btn-primary">创建揭示板</a> -->

                <?php endif ?>


            </div>
        </div>

    </div>
    <!-- Nav tabs -->
</div>


